﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace MyERP.Models
{
    /// <summary>
    /// 客户实体类
    /// </summary>
    public class Client
    {
        public int Id { get; set; }
        public string Name { get; set; }
        public string Address { get; set; }
        public string PhoneNumber { get; set; }
    }
    public class ClientConfig : IEntityTypeConfiguration<Client>
    {
        public void Configure(EntityTypeBuilder<Client> builder)
        {
            builder.ToTable("T_Client");
            builder.Property(e => e.Name).HasMaxLength(20);
            builder.Property(e => e.Address).HasMaxLength(50);
            builder.Property(e => e.PhoneNumber).HasMaxLength(20);
        }
    }
}
